package com.style_transfer.dao;

import com.style_transfer.model.Image;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ImageDao {

    @Select("select * from image where im_id = #{im_id} and type = 0")
    public Image getImageByID(@Param("im_id") int im_id);

    @Select("select * from image where im_id = #{im_id} and type = 1")
    public Image getVideoByID(@Param("im_id") int im_id);

    @Select("select * from image where l_id = #{l_id} and type = 0")
    public Image getImage(@Param("l_id") int l_id);

    @Select("select * from image where l_id = #{l_id} and type = 1")
    public Image getVideo(@Param("l_id") int l_id);

    public List<Image> getImageByName(String l_name);

    public List<Image> getAllImage();

    public List<Image> getAllVideo();

}
